package com.marklogic.ps.servicetester.gui;

import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeSelectionModel;

public class TreePanel extends JPanel {
	private JTree tree;
	public TreePanel(TreeModel treeModel) {
		super();
        this.setLayout(new GridLayout());

        tree = new JTree(treeModel);
        tree.setRowHeight(20);
        tree.getSelectionModel().setSelectionMode(
                TreeSelectionModel.SINGLE_TREE_SELECTION);
        //tree.setCellRenderer(new OrganizationTreeCellRenderer());
        //tree.addTreeExpansionListener(this);
        //JTreeUtils.scrollTree(tree, 2);

        JScrollPane scrollPane = new JScrollPane(tree);
        scrollPane.setBackground(Color.WHITE);
        //scrollPane.setBorder(BorderFactory.createEmptyBorder(TaskPlannerConfig.CALENDAR_HEIGHT, 0, 0, 0));
        this.add(scrollPane);
	}
}
